<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--通过按钮的事件调用方法-->
<input type="button" value="按钮" onclick="f1()">

<script>
    //1无参无返值
    function f1() {
        console.log("f1");
    }
    f1();
    //2有参无返回值
    function f2(name,age) {
        console.log(name+":"+age)
    }
    f2("刘德华",30)
    //3无参有返回值
    function f3() {
        return"这是返回值";
    }
    let info=f3();
    console.log(info);
    //4有参数有返回值
    function f4(x,y) {
        return x*y;
    }
    let result=f4(6,9);
    console.log(result);
    //第二种声明方法的方式
    let f5=function (name,age) {
        console.log(name+":"+age);
    }
    f5("刘备",55);
</script>
</body>
</html>